package View;

import java.awt.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class RecordFrame extends JFrame{

	public static Container container;
	
	public RecordFrame(String name){
		container=getContentPane();
    	setVisible(true);
    	setTitle(name);
    	setSize(800,600);
    	Dimension screenSize=Toolkit.getDefaultToolkit().getScreenSize();
		int screenWidth=screenSize.width;
		int screenHeight=screenSize.height;
		int x=(screenWidth-getWidth())/2;
		int y=(screenHeight-getHeight())/2;
		setLocation(x,y);
    	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);	
		setResizable(false);  
	}
	public static void addPanel(ModelPanel panel){
        container.removeAll();
    	container.add(panel,BorderLayout.CENTER);
      	container.setVisible(true);
      	container.invalidate();
      	container.validate();
    }
}
